<include file="Public:js" /> 
<div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="#">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">入驻商列表</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="{:U('Securityqr/fweimalist')}" method="get">
                    <table class="search-tab">
                        <tr>
                           
                            
                            <th width="70">产品:</th>
                            <td><input class="common-text" placeholder="关键字" name="goods_name" value="{$goods_name}" id="" type="text"></td>
                            <th width="70">所属商家:</th>
                            <td><input class="common-text" placeholder="关键字" name="supplier_name" value="{$supplier_name}" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                            <!-- <td><input class="btn btn-primary btn2" onclick="daochu()"  value="导出" type="button"></td> -->
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <script >
            function daochu(){

            }
        </script>
        <div class="result-wrap">
           
                
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <!--<th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>-->
                            <th>ID</th>
                            <th>防伪码</th>
                            <th>所属商家</th>
                            <th>产品名称</th>
                            
                            <th>添加时间</th>
                            
                            <th>查询次数</th>
                             <!-- <th>状态</th> -->
                            <th>操作</th>
                        </tr>
                        <foreach name="listinfo" item="vo"> 
                        <tr>
                            <!--<td class="tc"><input name="id[]" value="59" type="checkbox"></td>-->
                            <td>
                                <input type="checkbox" name="id[]" value="{$vo.qr_id}" />
                             {$vo.qr_id}
                            </td>
                            <td>{$vo.qr_sn}</td>
                            <td>{$vo.supplier_nam}</td>
                            <td title="{$vo.goods_name}">{$vo.goods_name}</td>
                            
                            
                            <td>{$vo.add_time|date="Y-m-d H:i:s",###}</td>
                            <td>{$vo.y_number}</td>
                            <!-- <td><if condition="$vo.qr_start eq 1 ">冻结<else /> 正常</if></td> -->
                            <td>
                                 <!-- <if condition="$vo.qr_start eq 1 ">
                                    <a class="link-update" href="{:U('Securityqr/fwmJiedong',array('qr_id'=>$vo['qr_id']))}">解冻
                                </a>
                                <else /> 
                                    <a class="link-update" href="{:U('Securityqr/fwmDongjie',array('qr_id'=>$vo['qr_id']))}">冻结
                                </a>
                                </if> -->
                                <a class="link-del" href="{:U('Securityqr/delFwm',array('qr_id'=>$vo['qr_id']))}">删除</a>
                            </td>
                            
                        </tr>
                        
                        </foreach> 

                        <tr>
                        <td><input type="button" value="全选" class="btn" id="selectAll"></td>
                            <td colspan="6"> 
                            <input type="button" value="删除" class="btn" onclick="DelSelect()">
                            </td>
                        </tr>
                    </table>
                    <div class="list-page"> {$page}</div>
                </div>
          
        </div>
    </div>
    <script type="text/javascript">
    //全选
    $("#selectAll").click(function(){ 
      $("input[name='id[]']").each(function(){
          if (this.checked) {
              this.checked = false;
          }
          else {
              this.checked = true;
          }
      });
    })

//批量删除
function DelSelect(){
 
    check_val = []; 
     $("input[name='id[]']").each(function(){
      if (this.checked==true) {
          check_val.push($(this).val());          
      }

     });
   // alert(check_val.length)
   if(check_val.length){   
        if (confirm("您确定要删除吗?")) {
          $.ajax({
             type: "POST",
             url: "{:U('Securityqr/delAllqr')}",
             data: "id="+check_val,
             success: function(data){
                alert(data.msg);
              window.location.reload();
               // alert(data.msg);
               // location.href = "{:U('Jingdian/lists')}"; 
              // location.reload();
            }
          }); 
        }  
         
      // alert(check_val)
    }else{
      alert('请先选中删除项'); 
      
    }
 
}

</script>